<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
        <div id="1" class="11">div1</div>
        <div id="2">div2</div>
        <div id="3" class="11">div3</div>
        <p id="4" class="22">p1</p>
        <p>p2</p>
        <p>p3</p>
        <p>p4</p>
        <p>p5</p>
        <img src="" alt="" id="5" class="33">
        <ol id="6" class="44">
            <li>列表</li>
            <li>列表</li>
        </ol>

        
</body>
      <script>
          //id
        var a=document.getElementById('1')
        console.log(a)
        var b=document.getElementById('4')
        console.log(b)
        var c=document.getElementById('5')
        console.log(c)
        var d=document.getElementById('6')
        console.log(d)
        //类
        var aa=document.getElementsByClassName('11')
        console.log(aa)
        var bb=document.getElementsByClassName('22')
        console.log(bb)
        var cc=document.getElementsByClassName('33')
        console.log(cc)
        var dd=document.getElementsByClassName('44')
        console.log(dd)
        //标签
        var aaa=document.getElementsByTagName('div')
        console.log(aaa)
        var bbb=document.getElementsByTagName('p')
        console.log(bbb)
        var ccc=document.getElementsByTagName('img')
        console.log(ccc)
        var ddd=document.getElementsByTagName('ol')
        console.log(ddd)
      </script>
</html>